package com.fun;

import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.jasypt.util.text.BasicTextEncryptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;

@SpringBootApplication
@EnableEncryptableProperties
@PropertySource(name = "EncryptedProperties", value = "classpath:encrypted.properties")
public class JsyptApplication {

    public static void main(String[] args) {
        SpringApplication.run(JsyptApplication.class, args);
    }

    @Bean
    public BasicTextEncryptor basicTextEncryptor() {
        return new BasicTextEncryptor();
    }
}
